package com.kk.nb_car.controller.admin;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.kk.nb_car.bean.Car;
import com.kk.nb_car.service.CarService;
import com.woniuxy.boot.common.pojo.ResultObj;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: K
 * @Date: 2024/12/17
 * 
 */
@RestController("adminCarController")
@RequestMapping("admin/car")
public class CarController {
    @Autowired
    private CarService carService;

    /**
     * 根据汽车id获取车辆信息
     * @param id
     * @return
     */
    @GetMapping("getCarInfo")
    public Car getCarInfo(@RequestParam("id") Long id) {
        return carService.getOne(new LambdaQueryWrapper<Car>().eq(Car::getId, id));
    }
}

